﻿/*****************************************************************//**
 * @file   VAOneXMLAdaptorAcousticsNCTLayUp.h
 * @brief  VAOne读写适配器多层声学包
 *
 * @author liuzhiyuan(liuzhiyuan@diso.cn)
 * @date   2024-11-05
 *********************************************************************/
#ifndef VAONEXMLADAPTORACOUSTICSNCTLAYUP_H
#define VAONEXMLADAPTORACOUSTICSNCTLAYUP_H

#include "FITKVAOneXMLIOAPI.h"
#include "FITKAbstractVAOneXMLAdaptor.h"
#include "FITK_Kernel/FITKCore/FITKCoreMacros.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"
#include "rapidxml.hpp"

namespace IO
{
    /**
     * @brief   VAOne读写适配器多层声学包
     * @author  liuzhiyuan(liuzhiyuan@diso.cn)
     * @data    2024-11-05
     */
    class FITKVAOneXMLIOAPI VAOneXMLAdaptorAcousticsNCTLayUp : public FITKAbstractVAOneXMLAdaptor
    {
        FITKCLASS(IO, VAOneXMLAdaptorAcousticsNCTLayUp);
    public:
        /**
         * @brief   构造函数
         * @author  liuzhiyuan(liuzhiyuan@diso.cn)
         * @data    2024-11-05
         */
        explicit VAOneXMLAdaptorAcousticsNCTLayUp()= default;
        /**
         * @brief   析构函数
         * @author  liuzhiyuan(liuzhiyuan@diso.cn)
         * @data    2024-11-05
         */
        ~VAOneXMLAdaptorAcousticsNCTLayUp() = default;
        /**
         * @brief   适配器读数据
         * @return  是否执行成功
         * @author  liuzhiyuan(liuzhiyuan@diso.cn)
         * @date    2024-11-05
         */
        bool adaptR() override;
        /**
         * @brief   适配器写数据
         * @return  是否执行成功
         * @author  liuzhiyuan(liuzhiyuan@diso.cn)
         * @date    2024-11-05
         */
        bool adaptW() override;

    private:
        /**
         * @brief   读取多层声包
         * @return  是否执行成功
         * @author  liuzhiyuan(liuzhiyuan@diso.cn)
         * @date    2024-11-05
         */
        bool readNCTLayUp();
        /**
         * @brief   写多层声包
         * @return  是否执行成功
         * @author  liuzhiyuan(liuzhiyuan@diso.cn)
         * @date    2024-11-05
         */
        bool writeNCTLayUp();
        /**
         * @brief   读取多层声包层
         * @return  是否执行成功
         * @author  liuzhiyuan(liuzhiyuan@diso.cn)
         * @date    2024-11-05
         */
        bool readreadNCTAbstractLay();
        /**
         * @brief   写多层声包层
         * @return  是否执行成功
         * @author  liuzhiyuan(liuzhiyuan@diso.cn)
         * @date    2024-11-05
         */
        bool writereadNCTAbstractLay();

        /**
         * @brief   读取多层声包层：常规层
         * @param[i] index 索引
         * @return  是否执行成功
         * @author  liuzhiyuan(liuzhiyuan@diso.cn)
         * @date    2024-11-05
         */
        bool readTrimLayer(int index, int type, rapidxml::xml_node<char>* node);
    };
    Register2FITKIOAdaptorFactory(VAOneXML, Acoustics::FITKAcousticsNCTLayUp, VAOneXMLAdaptorAcousticsNCTLayUp)
}
#endif // VAONEXMLADAPTORACOUSTICSNCTLAYUP_H
